<?php
  echo $this->Html->css('calendar/fullcalendar');
?>

<div id="content">
	<!--  start page-heading -->
	<div id="page-heading">
		<h1><?php echo __('Event Type');?></h1>
    <?php //echo $this->Html->link("Ticket", array('action' => 'add')); ?>&nbsp;&nbsp;
	</div>
	<!-- end page-heading -->
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
  	<tr>
  		<th rowspan="3" class="sized">
          <?php echo $this->Html->image('/images/shared/side_shadowleft.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
      </th>
  		<th class="topleft"></th>
  		<td id="tbl-border-top">&nbsp;</td>
  		<th class="topright"></th>
  		<th rowspan="3" class="sized">
          <?php echo $this->Html->image('/images/shared/side_shadowright.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
      </th>
  	</tr>
  	<tr>
  		<td id="tbl-border-left"></td>
  		<td>
  		<!--  start content-table-inner ...................................................................... START -->
    		<div id="content-table-inner">
      			<!--  start table-content  -->
      			<div id="table-content">

                <div class="eventTypes view">
                    	<dl><?php $i = 0; $class = ' class="altrow"';?>
                    		<dt<?php if ($i % 2 == 0) echo $class;?>><?php echo __('Name'); ?></dt>
                    		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
                    			<?php echo $eventType['EventType']['name']; ?>
                    			&nbsp;
                    		</dd>
                    		<dt<?php if ($i % 2 == 0) echo $class;?>><?php echo __('Color'); ?></dt>
                    		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
                    			<?php echo $eventType['EventType']['color']; ?>
                    			&nbsp;
                    		</dd>
                    	</dl>
                </div>
                <div class="actions">
                  	<ul>
                  		<li><?php echo $this->Html->link(__('Edit Event Type', true), array('action' => 'edit', $eventType['EventType']['id'])); ?> </li>
                  		<li><?php echo $this->Html->link(__('Delete Event Type', true), array('action' => 'delete', $eventType['EventType']['id']), null, sprintf(__('Are you sure you want to delete %s?', true), $eventType['EventType']['name'])); ?> </li>
                  		<li><?php echo $this->Html->link(__('Manage Event Types', true), array('action' => 'index')); ?> </li>
                  		<li><?php echo $this->Html->link(__('View Calendar', true), array('controller' => 'calendars')); ?></li>
                  	</ul>
                </div>
                <div class="related">
                	<h3><?php echo __('Related Events');?></h3>
                	<?php if (!empty($eventType['Event'])):?>

            				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
              				<tr>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo __('Title'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo __('Status'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo __('Start'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo __('End'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo __('All Day'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo __('Modified'); ?>
                        </th>
              					<th class="table-header-repeat line-left">
                             Action
                        </th>          
              				</tr>
                    	<?php
                    		$i = 0;
                    		foreach ($eventType['Event'] as $event):
                    			$class = null;
                    			if ($i++ % 2 == 0) {
                    				$class = ' class="altrow"';
                    			}
                    		?>
                    		<tr<?php echo $class;?>>
                    			<td><?php echo $event['title'];?></td>
                    			<td><?php echo $event['status'];?></td>
                    			<td><?php echo $event['start'];?></td>
                                <td><?php if($event['all_day'] != 1) { echo $event['end']; } else { echo "N/A"; } ?></td>
                                <td><?php if($event['all_day'] == 1) { echo "Yes"; } else { echo "No"; }?></td>
                    			<td><?php echo $event['modified'];?></td>
                    			<td class="actions">
                    				<?php echo $this->Html->link(__('View', true), array('controller' => 'events', 'action' => 'view', $event['id'])); ?>
                    				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'events', 'action' => 'edit', $event['id'])); ?>
                    			</td>
                    		</tr>
                  	<?php endforeach; ?>
                	</table>
                <?php endif; ?>
                </div>

      <!--  end content-table  -->
    		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>
